<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="lg"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="lg2"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta name="renderer" content="webkit|ie-comp|ie-stand">
        <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
        <meta name="viewport" content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8,target-densitydpi=low-dpi" />
        <meta http-equiv="Cache-Control" content="no-siteapp" />
        <link rel="stylesheet" href="${pageContext.request.contextPath}/static/css/font.css">
	<link rel="stylesheet" href="${pageContext.request.contextPath}/static/css/xadmin.css">
    <script type="text/javascript" src="https://cdn.bootcss.com/jquery/3.2.1/jquery.min.js"></script>
    <script type="text/javascript"src="https://cdn.bootcss.com/blueimp-md5/2.10.0/js/md5.min.js"></script>
    <script src="${pageContext.request.contextPath}/static/lib/layui/layui.js" charset="utf-8"></script>

    <script type="text/javascript" src="${pageContext.request.contextPath}/static/js/xadmin.js"></script>
    <script type="text/javascript" src="${pageContext.request.contextPath}/static/js/cookie.js"></script>
	
</script>
<script type="text/javascript"
	src="${pageContext.request.contextPath}/static/js/xadmin.js"></script>
<script type="text/javascript"
	src="${pageContext.request.contextPath}/static/js/cookie.js"></script>
<!-- 让IE8/9支持媒体查询，从而兼容栅格 -->
<!--[if lt IE 9]>
      <script src="https://cdn.staticfile.org/html5shiv/r29/html5.min.js"></script>
      <script src="https://cdn.staticfile.org/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->
</head>

<body>
<div class="layui-fluid" >
    <div class="layui-row">
	<form class="layui-form" >
		<div class="layui-form-item ">
			<input type="hidden" value="${pid}" name="plan_id">
			<label for="contract_code" class="layui-form-label">选择课程</label>
			<div class="layui-input-inline">
				<select class="form-control" name="course_id">
					<option value="">请选择</option>
					<lg:forEach items="${courseList}" var="course">
						<option value="${course.course_id}">${course.course_name}</option>
					</lg:forEach>

				</select>
			</div>
		</div>
		<div class="layui-form-item">
			<label for="inputEmail3" class="layui-form-label"></label>
			<div class="col-sm-5">
				<button lay-submit class="layui-btn" lay-filter="add" >完成</button>
			</div>
		</div>
	</form>	
	</div>
</div>
	<script type="text/javascript"
		src="${pageContext.request.contextPath}/static/js/jquery-1.12.3.min.js"></script>
	<script type="text/javascript"
		src="${pageContext.request.contextPath}/static/js/bootstrap.min.js"></script>
 <script>
 layui.use(['form', 'layer'],
		 function() {
	        	$ = layui.jquery;
	            var form = layui.form,
	            layer = layui.layer;
                //监听提交
                form.on('submit(add)',
                function(data) {
                    console.log(data);
                    $.ajax({
                    	url:"${pageContext.request.contextPath}/train/addC2P",
                    	data:data.field,
                    	success:function(data){
                    		
                    	}
                    })
                    //发异步，把数据提交给php
                    layer.alert("添加成功", {
                        icon: 6
                    },
                    function() {
                        //关闭当前frame
                        x_admin_close();
                        x_admin_father_reload();
                    });
                    return false;
                });

            });</script>
</body>
</html>